package com.qinglei.recoup.common.domain;

/**
 * 雷达设备协议枚举类
 */
public enum RadarVersionEnum {
    /**
     * 3.0协议
     */
    VERSION_V3("3_0", "3.0协议"),
    /**
     * 4.0协议
     */
    VERSION_V4("4_0", "4.0协议"),
    /**
     * 7.0协议
     */
    VERSION_V7("7_0", "7.0协议");

    /**
     * 代码
     */
    private String code;
    private String name;

    RadarVersionEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static RadarVersionEnum getByCode(String code) {
        for (RadarVersionEnum e : RadarVersionEnum.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return RadarVersionEnum.VERSION_V4;
    }
}
